#ifndef MENU_HANDLER_HH_
# define MENU_HANDLER_HH_

# include "../../interfaces/blitable.hh"
# include "../window.hh"
# include "menu.hh"

# include <list>
# include <tools/double_linked_list.hh>

class MenuHandler : public Blitable
{
public:
  MenuHandler (Window* w);
  ~MenuHandler ();

  void add_menu (Menu* m, bool is_active);
  void delete_menu (Menu* m, bool is_active);

  void desactivate (Menu* m);
  void activate (Menu* m);

  void update_hoover ();
  bool on_click (unsigned int button_id);
  void on_release (unsigned int button_id);

  void dispatch () const;

protected:
  Vector2d window_size_;
  DoubleLinkedList<Menu*>* active_menu_;
  DoubleLinkedList<Menu*>* unactive_menu_;

  Menu* current_menu_;
  Vector2d current_pos_;
};

#endif /// !MENU_HANDLER_HH_
